From: Keir Fraser Date: Thu, 5 Jun 2008 09:30:29 +0000 (+0100) Subject: Fix blkif.py for virsh start X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14200^2~101 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=cea190c247ccf5bf8b1dfc61ba15d80a34d4c579;p=xen.git Fix blkif.py for virsh start I defined a cdrom to a guest domain as follows. ",hdc:cdrom,r" When the guest domain was created by using xm create command, uname of the cdrom was ''. Then creating the guest domain succeeded. [2008-06-03 15:23:41 xend.XendDomainInfo 25956] DEBUG (XendDomainInfo:200) XendDomainInfo.create(['vm', ['name', 'rhel5.2ga_hvm_lvol1'], <> ['device', ['vbd', ['uname', ''], ['dev', 'hdc:cdrom'], ['mode', 'r']]], <> But, when the guest domain was created by using virsh start command, uname of the cdrom was None. Then creating the guest domain failed. [2008-06-03 15:22:10 xend.XendDomainInfo 25559] DEBUG (XendDomainInfo:200) XendDomainInfo.create(['vm', ['name', 'rhel5.2ga_hvm_lvol1'], <> ['device', ['vbd', ['dev', 'hdc:cdrom'], ['mode', 'r']]], <> This patch fixes to be able to create guest domains by both xm create command and virsh start command. FYI: "if uname is None:" --> "if uname == '':" --> "if not uname:" till CS#17625 current by this patch Signed-off-by: Masaki Kanno --- diff --git a/tools/python/xen/xend/server/blkif.py b/tools/python/xen/xend/server/blkif.py index 4a9282eb11..5238099c22 100644 --- a/tools/python/xen/xend/server/blkif.py +++ b/tools/python/xen/xend/server/blkif.py @@ -47,7 +47,7 @@ class BlkifController(DevController): except ValueError: dev_type = "disk" - if uname == '': + if not uname: if dev_type == 'cdrom': (typ, params) = ("", "") else: